package com.chenhao.springcloud.chenhaodesignservice.pattern.creational.singleton;

import java.io.Serializable;

/**
 * Description:饿汉式单例
 *
 * @author chenhao
 * @date 2020/12/17 13:57
 */
public class HungrySingleton implements Serializable {
    private  final  static  HungrySingleton hungryleton = new HungrySingleton();
    private HungrySingleton(){

    }
    public static HungrySingleton getInstance(){
        return  hungryleton;
    }

    private Object readResolve(){
        return hungryleton;
    }
}
